]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Fix dropping window on the indicators and at the screen edge for "+"
authorMaxim Ermilov <zaspire@rambler.ru>
Tue, 16 Mar 2010 23:21:24 +0000 (02:21 +0300)
committerMaxim Ermilov <zaspire@rambler.ru>
Wed, 17 Mar 2010 17:41:38 +0000 (20:41 +0300)
https://bugzilla.gnome.org/show_bug.cgi?id=607821

js/ui/workspacesView.js

index 6555e3d77e98d0926e6cd95da8f132ac6d2c3dc9..bfe5f7d7b03bda30e0705349d779f506a098bdcd 100644 (file)
@@ -774,6 +774,22 @@ SingleView.prototype = {
     },
 
     acceptDrop: function(source, dropActor, x, y, time) {
+        if (x < this._x || y < this._y || y > this._y + this._height) {
+            this._dropGroup.lower_bottom();
+            dropActor.hide();
+            let target = global.stage.get_actor_at_pos(Clutter.PickMode.ALL, x, y);
+            dropActor.show();
+
+            if (target._delegate && target._delegate != this && target._delegate.acceptDrop) {
+                let [targX, targY] = target.get_transformed_position();
+                return target._delegate.acceptDrop(source, dropActor,
+                                                   (x - targX) / target.scale_x,
+                                                   (y - targY) / target.scale_y,
+                                                   time);
+            }
+            return false;
+        }
+
         for (let i = 0; i < this._workspaces.length; i++) {
             let [dx, dy] = this._workspaces[i].actor.get_transformed_position();
             let [dw, dh] = this._workspaces[i].actor.get_transformed_size();
@@ -784,7 +800,7 @@ SingleView.prototype = {
 
         let [dx, dy] = this._newWorkspaceArea.actor.get_transformed_position();
         let [dw, dh] = this._newWorkspaceArea.actor.get_transformed_size();
-        if (x > dx && x < dx + dw && y > dy && y < dy + dh)
+        if (x > dx && y > dy && y < dy + dh)
             return this._acceptNewWorkspaceDrop(source, dropActor, x, y, time);
 
         return false;
@@ -822,7 +838,7 @@ SingleView.prototype = {
 
         let [dx, dy] = this._newWorkspaceArea.actor.get_transformed_position();
         let [dw, dh] = this._newWorkspaceArea.actor.get_transformed_size();
-        this._newWorkspaceArea.setStyle(x > dx && x < dx + dw && y > dy && y < dy + dh);
+        this._newWorkspaceArea.setStyle(x > dx && y > dy && y < dy + dh);
 
         [dx, dy] = this._leftShadow.get_transformed_position();
         [dw, dh] = this._leftShadow.get_transformed_size();